package com.cbwl.eoas.cms.web.controller.eoas;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cbwl.eoas.cms.api.eoas.IAppMailSendRecordService;
import com.cbwl.eoas.cms.model.eoas.AppMailSendRecordDTO;
import com.cbwl.eoas.cms.web.controller.login.LoginController;
import com.cbwl.eoas.common.framework.session.SessionManager;
import com.cbwl.eoas.common.framework.vo.PageRequest;



/**
 * 
 * <p>[描述信息：邮件发送记录Controller]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月12日 下午13:29:23
 */
@Controller
@RequestMapping("/appmailsendrecord")
public class AppMailSendRecordController {
	
	//业务层注解
	@Autowired
	private IAppMailSendRecordService appMailSendRecordService;
	
	
	private static Logger logger = LoggerFactory.getLogger(AppMailSendRecordController.class);
	
	
	/**
	 * <p>初始化界面</p>
	 * 
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/initAppMailSendRecord")
	public String initAppMailSendRecordPage() {
		return "initAppMailSendRecord";
	}


	/**
	 * <p>初始化新增修改界面</p>
	 * 
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/initAddUpdateAppMailSendRecordPage")
	public String initAddUpdateAppMailSendRecordPage(HttpServletRequest request,AppMailSendRecordDTO bean) {
		request.setAttribute("bean", bean);
		return "initAddUpdateAppMailSendRecordPage";
	}
	

	/**
	 * <p>查询（分页）</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/queryAppMailSendRecordPage")
	@ResponseBody
	public Object  queryAppMailSendRecordPage(HttpServletRequest request,AppMailSendRecordDTO bean,PageRequest pageRequest) {
		return appMailSendRecordService.queryPageList(bean, pageRequest);
	}

	/**
	 * 
	 * <p>通过id查询主体信息</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/getAppMailSendRecordById")
	@ResponseBody
	public Object getAppMailSendRecordById(HttpServletRequest request,AppMailSendRecordDTO bean) {
		return appMailSendRecordService.getObjectById(bean);
	}

	/**
	 * 
	 * <p>保存主体信息</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/saveAppMailSendRecord")
	@ResponseBody
	public Object saveAppMailSendRecord(HttpServletRequest request,AppMailSendRecordDTO bean) throws Exception {

		return appMailSendRecordService.saveObject(bean);
	}

	/**
	 * 
	 * <p>更新主体信息</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 */
	@RequestMapping("/updateAppMailSendRecord")
	@ResponseBody
	public Object updateAppMailSendRecord(HttpServletRequest request,AppMailSendRecordDTO bean) throws Exception {
		return appMailSendRecordService.updateObject(bean);
	}

	/**
	 * 
	 * <p>删除主体信息</p>
	 * 
	 * @param bean
	 * @return
	 * @author 虞云波 - yuyunbo@3856.cc 
	 * @version 1.0 Created on 2017年10月12日 下午13:29:23
	 * @throws Exception 
	 */
	@RequestMapping("/deleteAppMailSendRecord")
	@ResponseBody
	public Object deleteAppMailSendRecord(HttpServletRequest request,AppMailSendRecordDTO bean) throws Exception {
		return appMailSendRecordService.deleteObject(bean);
	}
}
